"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const maishu_node_mvc_1 = require("maishu-node-mvc");
const path = require("path");
const entities_1 = require("./entities");
const common_1 = require("common");
class MemberDataContext extends common_1.DataContext {
    constructor(manager) {
        super(manager);
        this.user = manager.getRepository(entities_1.User);
    }
}
exports.MemberDataContext = MemberDataContext;
async function createDataContext(db) {
    let dc = await common_1.DataContext.createInstance(db, MemberDataContext, entitiesPath);
    return dc;
}
exports.createDataContext = createDataContext;
let entitiesPath = path.join(__dirname, "entities.js");
exports.memberDataContext = maishu_node_mvc_1.createParameterDecorator(async (a, b, serverContext) => {
    let dc = await common_1.DataContext.createInstance(serverContext.data.db, MemberDataContext, entitiesPath);
    return dc;
});
